export function tag(value) {
  if (value.length == 0) {
    return "至少输入一个标签"
  } else {
    let show = true
    for (let i in value) {
      let tempValue
      if (value[i].name == undefined) tempValue = value[i]
      else tempValue = value[i].name
      let len = 0
      for (let j = 0; j < tempValue.length; j++) {
        let c = tempValue.charCodeAt(j);
        // 单字节(如字母)加1 双字节（如中文）不一样处理，现在都是1
        if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) len ++ 
        else len += 1
      }
      if (len > 10) show = false
    }
    if (!show) return "标签名长度不能超过10！"
    else return null
  }
}
